﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Istace.Framework.Mapping.Core;
using Istace.Framework.Mapping.Core.Interfaces;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Istace.Framework.Mapping.UnitTest
{
    [TestClass]
    public class MapperFacadeTest
    {
        [TestMethod]
        public void SetMapperServiceWithCorrectInstance()
        {
            Mapper.SetInstance(new MockedMapperService());
            Mapper.Reset();
            Assert.IsTrue(true);
        }

        [TestMethod]
        public void SetBootstrapperWithCorrectInstance()
        {
            Mapper.SetInstance(new MockedMappingFrameworkBootstrapper());
            Mapper.Reset();
            Assert.IsTrue(true);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void SetMapperServiceWithNullInstance()
        {
            Mapper.SetInstance(null as IMapperService);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void SetBootstrapperWithNullInstance()
        {
            Mapper.SetInstance(null as IMappingFrameworkBootstrapper);
        }
    }
}
